import { SRDeviceAlertStatusEnum, SRFileTypeEnum } from "./sr.enum";

/**
 * starriver mqtt description 中的 file
 */
export class SRMqttFile {
  constructor(type: SRFileTypeEnum) {
    this.type = type;
  }
  id?: string;
  type: SRFileTypeEnum;
}

/**
 * starriver mqtt device alert
 */
export class SRMQTTDeviceAlert {
  constructor() {
    this.timestamp = new Date().toISOString();
  }

  timestamp: string; // 报警时间(ISO8601格式 "2018-08-07T08:15:00Z")
  status: SRDeviceAlertStatusEnum = SRDeviceAlertStatusEnum.DAS_NORMAL; // 设备状态
  value?: string; // 当前值 (可选)
  threshold?: string; // 阈值 (可选)
  description?: string;
}

/**
 * 字符串描述
 */
export class SRMQTTString {
  param?: string;
}

/**
 * starriver mqtt description
 */
export class SRMQTTDescription {
  files?: SRMqttFile[];
}
